<template>
  <el-timeline v-if="activities.length">
    <el-timeline-item
      v-for="(activity, index) in activities"
      :key="index"
      :timestamp="activity.preTime"
      placement="top"
    >
      <div class="content">
        <p>{{ activity.subject }}</p>
        <p>考试进度 [ 预约考试 ]</p>
        <p>备注：{{ activity.comment }}</p>
      </div>
    </el-timeline-item>
  </el-timeline>
  <el-empty v-else description="暂无数据" />
</template>
<script lang="ts" setup>
import { useRoute } from "vue-router";
import { preExamGet } from "../../../api/student";
const route = useRoute();
let {cardId} = route.query;
console.log("个人预考cardId",cardId);

//查询当前用的的预考记录
let res = await preExamGet(1, 10, {cardId});

const activities = res.data.results;

activities.sort((a: any, b: any) => {
  return new Date(a.preTime).getTime() - new Date(b.preTime).getTime();
});
</script>

<style lang="scss" scoped>
.content {
  font-weight: normal;
  color: #666;

  > p {
    margin-top: 16px;
  }
}
</style>